﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/HomeSite.Master" Inherits="System.Web.Mvc.ViewPage<TimeTableManagement.Entities.Tb_Room>" %>

<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<div id="dialog" title="New Room Type">
        <% using (Html.BeginForm("Create", "Config", FormMethod.Post))
           {%>
            <%: Html.Label("Room Type") %>
            <input id="displayword" name="displayword" type="text" value="" onkeypress="updatekeyword()">
            <input id="opntion" name="option" type="hidden" value="roomtype"/>
            <input id="keyword" name="keyword" type="hidden" />
            <%--Tao JS, khi click vao Save, tao keyword ngau nhien dua vao displayword--%>
            <input id="control" name="control" type="hidden" value="Room" />
            <input id="action" name="action" type="hidden" value="Create" />
            <p><input type="submit" value="Save" /></p>
            <script>
                function updatekeyword() {
                    $temp = document.getElementById('displayword').value;
                    document.getElementById('keyword').value = $temp.replace(/ /g, '-').substr(0,10);
                    return true;
                }
            </script>
         <% } %>
</div>

<div id="roomstatus" title="New Room Status">
        <% using (Html.BeginForm("Create", "Config", FormMethod.Post))
           {%>
            <%: Html.Label("Room Status") %>
            <input id="displayword2" name="displayword2" type="text" value="" onkeypress="updatekeyword2()">
            <input id="opntion2" name="option" type="hidden" value="roomstatus"/>
            <input id="keyword2" name="keyword" type="hidden"/>
            <%--Tao JS, khi click vao Save, tao keyword ngau nhien dua vao displayword--%>
            <input id="control2" name="control" type="hidden" value="Room" />
            <input id="action2" name="action" type="hidden" value="Create" />
            <p><input type="submit" value="Save" /></p>
            <script>
                function updatekeyword2() {
                    $temp = document.getElementById('displayword2').value;
                    document.getElementById('keyword2').value = $temp.replace(/ /g, '-').substr(0, 10);
                    return true;
                }
            </script>
         <% } %>
</div>

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

    <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="100%" 
        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
        GroupBoxCaptionOffsetY="-28px" 
        SpriteCssFilePath="~/App_Themes/Aqua/{0}/sprite.css">
        <ContentPaddings Padding="14px" />
        <PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
<% using (Html.BeginForm()) { %>
    <%: Html.ValidationSummary(true) %>
         <div class="editor-label">
            <%: Html.LabelFor(model => model.name,"Name") %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.name) %>
            <%: Html.ValidationMessageFor(model => model.name) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.type,"Type") %>
        </div>
        <div class="editor-field">
            <%: Html.DropDownList("type", String.Empty) %>
            <%: Html.ValidationMessageFor(model => model.type) %>
            <a href="#" onclick="jQuery('#dialog').dialog('open'); return false">New Room Type</a>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.max,"Max") %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.max) %>
            <%: Html.ValidationMessageFor(model => model.max) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.status,"Status") %>
        </div>
        <div class="editor-field">
            <%: Html.DropDownList("status", String.Empty) %>
            <%: Html.ValidationMessageFor(model => model.status) %>
            <a href="#" onclick="jQuery('#roomstatus').dialog('open'); return false">New Room Status</a>
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
<% } %>

<div>
    <%: Html.ActionLink("Back to List", "Index") %>
</div>

</dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
<script type="text/javascript">
    $(function () {
        $("#dialog").dialog({
            bgiframe: true,
            height: 150,
            width: 400,
            modal: true,
            autoOpen: false,
            resizable: false
        })
    });
        
    </script>
    <script type="text/javascript">
        $(function () {
            $("#roomstatus").dialog({
                bgiframe: true,
                height: 150,
                width: 400,
                modal: true,
                autoOpen: false,
                resizable: false
            })
        });
        
    </script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="leftmenu" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="menuright" runat="server">
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="Footer" runat="server">
</asp:Content>
